#include<bits/stdc++.h>
using namespace std;
using ll = long long;
char s[200003], t[200003];
bool f[200001][31];
ll from[200001][31];
bool f1[2001][2001];
ll from1[2001][2001];
ll n, m;
ll l[200001], r[200001];
ll res[200001];
int main() {
//	freopen("seq.in", "r", stdin);
//	freopen("seq.out", "w", stdout);
	ios::sync_with_stdio(false);
	cin.tie(0), cout.tie(0);
	cin >> (s + 1) >> (t + 1);
	n = strlen(s + 1), m = strlen(t + 1);
	for (int i = 1; i <= n; i++)
		if (s[i] == s[i - 1])
			l[i] = l[i - 1];
		else
			l[i] = i;
	for (int i = n; i >= 1; i--)
		if (s[i] == s[i + 1])
			r[i] = r[i + 1];
		else
			r[i] = i;
	if (n * m <= 4000000) {
		if (m <= 20) {
			f[0][0] = 1;
			for (int i = 0; i <= m; i++) {
				ll k = 0;
				for (ll j = 0; j <= n; j++) {
					k = max(j + 1, k);
					if (f[j][i] == 1) {
						for (; k <= r[j + 1] + 1 && k <= n + 1; k++)
							if (s[k] == t[i + 1])
								f[k][i + 1] = 1, from[k][i + 1] = j;
						if (s[j + 1] == t[i + 1])
							f[j + 1][i + 1] = 1, from[j + 1][i + 1] = j;
					}
				}
			}
			if (f[n + 1][m + 1] == 0)
				cout << "NO";
			else {
				cout << "YES\n";
				res[m + 1] = n + 1;
				for (int i = m + 1; i >= 1; i--)
					res[i - 1] = from[res[i]][i];
				for (int i = 1; i <= m; i++)
					cout << res[i] << ' ';
			}
		} else {
			f1[0][0] = 1;
			for (int i = 0; i <= m; i++) {
				ll k = 0;
				for (ll j = 0; j <= n; j++) {
					k = max(j + 1, k);
					if (f1[j][i] == 1) {
						for (; k <= r[j + 1] + 1 && k <= n + 1; k++)
							if (s[k] == t[i + 1])
								f1[k][i + 1] = 1, from1[k][i + 1] = j;
						if (s[j + 1] == t[i + 1])
							f[j + 1][i + 1] = 1, from[j + 1][i + 1] = j;
					}
				}
			}
			if (f1[n + 1][m + 1] == 0)
				cout << "NO";
			else {
				cout << "YES\n";
				res[m + 1] = n + 1;
				for (int i = m + 1; i >= 1; i--)
					res[i - 1] = from1[res[i]][i];
				for (int i = 1; i <= m; i++)
					cout << res[i] << ' ';
			}
		}
	} else {
		res[0] = 0;
		for (int i = 0; i <= m - 1; i++) {
			int j = res[i] + 1;
			for (; j <= m + 1; j++) {
				if (r[res[i] + 1] >= j - 1 && s[j] == t[i + 1]) {
					res[i + 1] = j;
					break;
				}
			}
			if (j == m + 2) {
				cout << "NO";
				exit(0);
			}
		}
		if (r[res[m]] != n) {
			cout << "NO";
			exit(0);
		}
		cout << "YES\n";
		for (int i = 1; i <= m; i++)
			cout << res[i] << ' ';
	}
	return 0;
}
